import { defineComponent } from "vue";
// import type { RouteRecordRaw } from 'vue-router'

type Component<T extends any = any> =
	| ReturnType<typeof defineComponent>
	| (() => Promise<typeof import("*.vue")>)
	| (() => Promise<T>);

export interface AppState {
	count: number;
}

export interface SettingsState {
	logo: string;
	title: any;
	user: any;
	name: string;
	usertoken: any;
}

export interface RouteMeta {
	title: string;
	icon: string;
}

export interface RouteRecord {
	id: string;
	name?: string;
	meta?: RouteMeta;
	children?: RouteRecord[];
	orderId?: number;
	path?: string;
	component?: Component | string;
	redirect?: string;
}

export interface RoutesState {
	routes: Array<object>;
	// routes: Array<AppRouteRecordRaw>,
}

// 主接口(顶级类型声明)
export interface RootStateTypes {
	app: AppState;
	routes: RoutesState;
	settings: SettingsState;
}
